<template>
  <el-row class="head">
    <el-col :span="4">
      <el-button @click="createSort()" type="primary">新增分类</el-button>
    </el-col>
    <el-col :span="8">
      <div class="block" v-show="false">
        <span class="demonstration">日期：</span>
        <el-date-picker
          v-model="value2"
          type="datetime"
          placeholder="日期和时间"
          format="YYYY/MM/DD hh:mm:ss"
          value-format="YYYY-MM-DD h:m:s a"
        />
      </div>
    </el-col>
    <!-- <el-col :span="6">
      <span class="demonstration">文章分类：</span>
      <el-select v-model="value" placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>
    </el-col> -->
    <el-col :span="12" class="form-search" v-show="false">
      <el-input
        placeholder="分类名称"
        prefix-icon="el-icon-search"
        v-model="input2"
        class="form-search-input"
      >
      </el-input>
      <el-button @click="search()" type="primary" style="margin-left: 20px"
        >搜索</el-button
      >
    </el-col>
  </el-row>
</template>

<script setup>
const input2 = ref('')
//
const emits = defineEmits(['createSortEmit', 'searchEmit'])
// 添加
const createSort = () => {
  emits('createSortEmit')
}

const search = () => {
  emits('searchEmit', input2.value)
}
</script>

<style lang="scss" scoped>
#form {
  padding: 20px;
}
.head {
  margin: 20px 0;
}
.form-search {
  display: flex;
  align-content: center;
  justify-content: right;
}
.form-search-input {
  text-align: right;
  width: 200px;
}
.form-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 20px auto;
}
.edit {
  padding: 20px 0;
}
.form-drawer {
  padding: 20px;
}
</style>
